Skip to content

chore: Update to use current upstream modules #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Andrews-repo
Copy link
Contributor

@Andrews-repo Andrews-repo commented Jul 29, 2025

Description
This PR updates the module to align with changes introduced in terraform-aws-modules/ecs/aws v6.x. Specifically, it updates the usage of the ECS service and cluster submodules to reflect current upstream expectations and field structures.

Motivation and Context
Align with upstream module conventions (terraform-aws-modules/ecs/aws v6.x)

Remove deprecated fields and adopt new syntax for ECS cluster and service configuration

Ensure future compatibility and reduce drift from supported patterns

Breaking Changes
Yes.

fargate_capacity_providers has been removed and replaced by default_capacity_provider_strategy, matching upstream behavior.

service_registries must now be set to null or omitted entirely — using an empty list [] will result in a type error. This aligns with upstream, which expects an object, not a list.

Some internal variable defaults and structures were updated to follow upstream expectations, which may cause errors if older formats are used without adjustment.

How Has This Been Tested?
Deployed using the updated module in a live production environment

Verified ECS service behavior and cluster creation

Please let me know if there additional changes or things needed I may of missed

@Andrews-repo Andrews-repo changed the title Update tp use current upstream modules Update to use current upstream modules Jul 29, 2025
@Andrews-repo Andrews-repo changed the title Update to use current upstream modules Chore: Update to use current upstream modules Jul 29, 2025
@Andrews-repo Andrews-repo changed the title Chore: Update to use current upstream modules chore: Update to use current upstream modules Jul 29, 2025
@Andrews-repo
Copy link
Contributor Author

@bryantbiggs I know you are a very busy man, and I apologize for bothering you, but is there anything i can do to assist with getting this reviewed and merged in? I have colleagues at other orgs hoping to use this update to the module

@bryantbiggs
Copy link
Member

I'll take a look this evening - apologies for the delay

@Andrews-repo
Copy link
Contributor Author

Andrews-repo commented Aug 4, 2025

No worries, I know you can be slammed with all the modules, and always get a laugh when you remind people all this is offered for free, so I wasnt going to rush you or anything. I appreciate your time

@@ -125,7 +125,7 @@ resource "random_password" "webhook_secret" {

module "secrets_manager" {
source = "terraform-aws-modules/secrets-manager/aws"
version = "~> 1.0"
version = "1.3.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in examples we don't pin to a specific version, so lets revert changes like this

Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a good start but I think theres still quite a bit of work to do on aligning with the ECS module changes in v6.x

@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are only raising to 1.5.7 at this time unless there is a strong reason for going higher - this should be carried throughout

Suggested change
required_version = ">= 1.10"
required_version = ">= 1.5.7"


tags = var.tags
}

module "ecs_service" {
source = "terraform-aws-modules/ecs/aws//modules/service"
version = "5.11.0"
version = "6.1.1"

create = var.create

# Service
ignore_task_definition_changes = try(var.service.ignore_task_definition_changes, false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the variable optional attributes, a lot of these try(() blocks should be removed


create = var.create

# Service
ignore_task_definition_changes = try(var.service.ignore_task_definition_changes, false)
alarms = try(var.service.alarms, {})
alarms = try(var.service.alarms, { alarm_names = [] })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

@@ -278,7 +279,7 @@ module "ecs_service" {
iam_role_description = try(var.service.iam_role_description, null)
iam_role_permissions_boundary = try(var.service.iam_role_permissions_boundary, null)
iam_role_tags = try(var.service.iam_role_tags, {})
iam_role_statements = lookup(var.service, "iam_role_statements", {})
iam_role_statements = lookup(var.service, "iam_role_statements", [])

# Task definition
create_task_definition = try(var.service.create_task_definition, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the container definition input values are now camelCased - so most of these below are incorrect

@@ -438,26 +437,32 @@ module "ecs_service" {
security_group_name = try(var.service.security_group_name, null)
security_group_use_name_prefix = try(var.service.security_group_use_name_prefix, true)
security_group_description = try(var.service.security_group_description, null)
security_group_rules = merge(
security_group_ingress_rules = merge(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the plan for an upgrade guide for these disruptive/breaking changes?

required_version = ">= 1.0"
required_version = ">= 1.10"

required_providers {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are no aws resources in the root module so we don't need the required provider here

@Andrews-repo
Copy link
Contributor Author

its a good start but I think theres still quite a bit of work to do on aligning with the ECS module changes in v6.x

Ill get started on these TY, and i think its the ACM module that used version 1.10, so i aligned with that, that said i beleive it was >= 1.10. Ill get this all fixed and answer some questions a little later when Im done with some work stuff

@bryantbiggs
Copy link
Member

its a good start but I think theres still quite a bit of work to do on aligning with the ECS module changes in v6.x

Ill get started on these TY, and i think its the ACM module that used version 1.10, so i aligned with that, that said i beleive it was >= 1.10. Ill get this all fixed and answer some questions a little later when Im done with some work stuff

ah, yes - it does https://github.com/terraform-aws-modules/terraform-aws-acm/blob/155b56d6b4263195ff528a609374de1fab22206b/versions.tf#L2

nvm, leave 1.10 as the min supported Terraform version then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants